/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Automato;

import java.util.ArrayList;
import java.util.Collections;

/**
 *
 * @author Gonçalo Fernandes
 */
public class FraseId {
    
    int id;
    ArrayList<Integer> count= new ArrayList<Integer>();

    public ArrayList<Integer> getCount() {
        return count;
    }

    

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public void IncrmentaCont()
    {
     int c=0;
     int sz=count.size();
     
    for(int i=0;i<sz;i++){
      
        c=count.get(i) + 1;
        
        count.set(i, count.get(i)+1);
       
    }}
    
    public int getValorMaxDoCount()
    {
      //ordena por ordem crescente
        Collections.sort(count);
       //retorna o ultimo do array
        int var=-1;
        if(!count.isEmpty())
        {
         var = count.size()-1;
        
      return count.get(var);}
        else return var;
    }
    
     public void RemoveMaxCount()
    {
      //ordena por ordem crescente
        Collections.sort(count);
       //remove o ultimo do array
      count.remove(count.size()-1);
      Collections.sort(count);
    }
     public void setNovaInstancia()
     {
       count.add(0);
       Collections.sort(count);
     }
     
     public boolean CountArrayIsEmpty()
     {   
         if(count.size()==0)
             return true;
         return false;
         
     }

}
